import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule, Routes } from '@angular/router';
import { PortfolioComponent } from './portfolio.component';
import { PortfolioListComponent } from './portfolioList/portfolioList.component';
import { TableModule } from '../../shared/components/table/table.module';
import { FormsModule } from '@angular/forms';
import { SearchModule } from '../../shared/components/search/search.module';
import { ModalModule } from '../../shared/components/modal/modal.module';
import { PortfolioCreationComponent } from './portfolioCreation/portfolioCreation.component';
import { PortfolioEditComponent } from './portfolioEdit/portfolioEdit.component';
import { UiSwitchModule } from 'ngx-ui-switch';
import { SweetAlert2Module } from '@toverux/ngx-sweetalert2';
import { PipesModule } from '../../shared/pipes/pipes.module';

const routes: Routes = [
    {
        path: '',
        component: PortfolioComponent
    },
    {
        path: 'edit/:id',
        component: PortfolioEditComponent,
    }
];

/**
 * Overall portfolio module.
 * Author: Mihai Stanescu
 * Date: 19.04.2018
 */
@NgModule({
    imports: [
        CommonModule,
        TableModule,
        TableModule,
        FormsModule,
        SearchModule,
        ModalModule,
        UiSwitchModule,
        SweetAlert2Module,
        PipesModule,
        RouterModule.forChild(routes)
    ],
    declarations: [
        PortfolioComponent,
        PortfolioListComponent,
        PortfolioCreationComponent,
        PortfolioEditComponent
    ],
    exports: [
        RouterModule
    ]
})
export class PortfolioModule { }
